package com.flute.haflute.jobbox.base.mapreduce;


import java.util.ArrayList;
import java.util.List;

/**
 * Map数据的收集器原型
 * 	   map任务执行后的内容保存于此，参考MapReduce机制
 * @author Liu Liu
 * @date 2010-5-17
 */
public class MapOutputCollector implements OutputCollector {

	List<String> keys = new ArrayList<String>();
	List<String> values = new ArrayList<String>();
	
	@Override
	public void collect(String key, String val) {
		keys.add(key);
		values.add(val);

	}

	@Override
	public List<Object> getKeys() {
		List<Object> result = new ArrayList<Object>();
		result.addAll(keys);
		return result;
	}

	@Override
	public List<Object> getVals() {
		List<Object> result = new ArrayList<Object>();
		result.addAll(values);
		return result;
	}

}
